from flask import Flask
from flask_migrate import Migrate
from flask_login import LoginManager
from config import Config
from models import db,User
from auth import auth
from main import main
app = Flask(__name__)
app.config.from_object(Config)

db.init_app(app)
migrate = Migrate(app, db)
login_manager = LoginManager(app)

app.register_blueprint(auth, url_prefix='/auth')
app.register_blueprint(main)

if __name__ == '__main__':
    with app.app_context():
        db.create_all()  # 创建数据库
    app.run(debug=True)
